<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<jsp:include page="/common/link.jsp"></jsp:include>
		<title>模块访问汇总表</title>
		<link href="<%=application.getContextPath()%>/nresources/ued/css/all-src.css" type="text/css" rel="stylesheet" />
		<%@include file="/WEB-INF/ibnms/common/easyui.jsp" %>
		<%@include file="/WEB-INF/ibnms/common/jqgrid.jsp"%>
		<%@ include file="/WEB-INF/ibnms/common/jsCommonVariables.jsp"%>
		<script type="text/javascript" src="<%=application.getContextPath()%>/njs/basd/My97DatePicker/WdatePicker.js"></script>
	</head>
<body>
<div class="form-wrapper">
	<div class="box-in">
	<form id="theForm" action="<s:url action="exportLogModuleGatherReport"/>">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-03">
	   <thead>
	   <tr>
	         <td width="100%" class="monitor_bg1" nowrap>
	         	开始时间：<input type="text" name="theForm.startTime" value="${theForm.startTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate" style="width:150px"/>
	         	结束时间：<input type="text" name="theForm.endTime" value="${theForm.endTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate" style="width:150px"/>
	         	模块：<input type="text" id="moduleName" name="moduleName" value="" onclick="selectModule();" style="width:150px"/>
	         		<input type="hidden" id="theForm_moduleId" name="theForm_moduleId" value=""/>
	         	部门：<input type="text" id="deptName" name="deptName" value="" onclick="selectDept();" style="width:150px"/>
	         		<input type="hidden" id="theForm_deptId" name="theForm_deptId" value=""/>
	         	操作人：<input type="text" id="userName" name="userName" value="" onclick="selectUser();" style="width:150px"/>
	         		<input type="hidden" id="theForm_userId" name="theForm_userId" value=""/>
				<input type="button"class="btn-style02" id="btn-search" value="查询" />
				<input type="button" class="btn-style02" id="btn-export" value="导出" /></td>		         		
	         </td>
	   </tr>
	   </thead> 
	  </table>
	  </form>
	</div>
	<div class="title-style"><a class="fold-tip"></a></div>
	<div class="block02">
		<table id="gridTable">
		</table>
		<div id="gridPager">
		</div>
	</div>
</div>

<script type="text/javascript">
		$(function(){
			$(".title-style a.fold-tip").toggle(toggletip,toggletip);
			function toggletip() {
				if ($(this).attr("class").split("unfold-tip").length > 1) {
					$(this).removeClass("unfold-tip");
					$(this).parents().prev(".box-in").show("fast");
				} else {
					$(this).addClass("unfold-tip");
					$(this).parents().prev(".box-in").hide("fast");
				}
			}
			$('#sel1').click(function(){
									  var height = $(window.parent.document.getElementById('sideframe')).height();
					$(window.parent.document.getElementById('sideframe')).css("display","none").next(".sideframe-collapse").css({"display":"block","height":height});
			})
		})
			$(function(){$("#gridTable").jqGrid({
					url: "logModuleGatherReportJSON.do",
					datatype: "json",
					mtype: "POST",
					height: "100%",
					autowidth: true,
					colNames:['访问模块','点击次数'],
					colModel:[
						{name:'MODULE_DIRECTORY',index:'MODULE_DIRECTORY'},
						{name:'NUM',index:'NUM'}
					],
					viewrecords: true,
					rowNum: 15,
					rowList: [10,15,30],
					sortname: 'NUM',
					sortorder: 'desc',
					jsonReader: {
						root: 'rows',
						page: 'page',
						total: 'total',
						records: 'records',
						repeatitems: false,
						subgrid: {
					        root: 'rows',
							page: 'page',
							total: 'total',
							records: 'records',
							repeatitems: false
					    }      
					},
					pager: "#gridPager",
					hidegrid: true,
					beforeRequest:function(){
						var postData = {};
						$(":input[name^='theForm']").each(function(){
							postData[$(this).attr("name")] = $(this).val();
						});
						$.extend($("#gridTable").getGridParam("postData"), postData);
					}
				});
				
			});
			
			function selectUser(){
				var selectUser = window.showModalDialog('<%=application.getContextPath()%>/loadUserManage.do?type=select','选择用户','help:no;scroll:no;status:no;dialogHeight:600px;dialogWidth:900px');
		   		if(selectUser!=undefined){
		   			var id = "";
		   			var name = "";
		   			for (var one in selectUser){
                    	id = id + selectUser[one].LOGIN_ID + ",";
                    	name = name + selectUser[one].NAME + ",";
                    }
                    if(id.length>0){
                    	id = id.substring(0,id.length-1);
                    	name = name.substring(0,name.length-1);
                    }
					$("#theForm_userId").val(id);
					$("#userName").val(name);
				}
			} 
			function selectDept(){
				var selectDept = window.showModalDialog('<%=application.getContextPath()%>/loadDeptManage.do?type=select','选择部门','help:no;scroll:no;status:no;dialogHeight:600px;dialogWidth:900px');
		   		if(selectDept!=undefined){
		   			var id = "";
		   			var name = "";
		   			for (var one in selectDept){
                    	id = id + selectDept[one].DEPT_ID + ",";
                    	name = name + selectDept[one].DEPT_NAME + ",";
                    }
                    if(id.length>0){
                    	id = id.substring(0,id.length-1);
                    	name = name.substring(0,name.length-1);
                    }
					$("#theForm_deptId").val(id);
					$("#deptName").val(name);
				}
			} 
			function selectModule(){
				var selectModule = window.showModalDialog('<%=application.getContextPath()%>/loadListModulesManage.do?type=select','选择模块','help:no;scroll:no;status:no;dialogHeight:600px;dialogWidth:900px');
		   		if(selectModule!=undefined){
		   			var id = "";
		   			var name = "";
		   			for (var one in selectModule){
                    	id = id + selectModule[one].MODULE_ID + ",";
                    	name = name + selectModule[one].MODULE_NAME + ",";
                    }
                    if(id.length>0){
                    	id = id.substring(0,id.length-1);
                    	name = name.substring(0,name.length-1);
                    }
					$("#theForm_moduleId").val(id);
					$("#moduleName").val(name);
				}
			} 
			
			$("#btn-search").click(function(){
				$("#gridTable").trigger("reloadGrid",[{page:1}]);
			});
			
			$("#btn-export").click(function(){
				$("#theForm").submit();
			});
</script>
</body>
</html:html>            
